import logging
import sys
def getLogger(logger_name,level=logging.DEBUG):
    file_handler = logging.FileHandler(filename="./data/"+logger_name+'.log')
    stdout_handler = logging.StreamHandler(sys.stdout)
    handlers = [file_handler, stdout_handler]

    logging.basicConfig(
        level=level,
        format='[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s',
        handlers=handlers
    )

    logger = logging.getLogger(logger_name)
    return logger